package com.company.cuobuliao.ui.welcome;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.company.cuobuliao.R;
import com.company.cuobuliao.main.MainActivity;
import com.company.cuobuliao.ui.login.LoginActivity;

/**
 * Created by Oreo on 2017/3/3.
 */

public class WelcomeActivity extends AppCompatActivity {

//    private MyApplication application;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
//        application = (MyApplication) getApplication();


        /*欢迎页面停留3秒并跳转MainActivity*/
        new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                startActivity(new Intent(WelcomeActivity.this, LoginActivity.class));
//                if (application.getIsFirstStart().equals("1")) {
//                    startActivity(new Intent(WelcomeActivity.this, GuideActivity.class));
//                } else {
//                    if (application.getmUser() == null || application.getmUser().getIs_gesture() == null || application.getmUser().getIs_gesture().equals("0")) {
//                        startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
//                    } else {
//                        startActivity(new Intent(WelcomeActivity.this, CheckGestureActivity.class));
//                    }
//                }
                finish();
            }
        }.start();
    }
}
